package package_monster;
import java.util.Random;
public class RandomStrategy implements Strategy{
	 public int SelectDirection(int a[][], int x, int y){
		int b[]=new int[4];
		int count=0;
		if (a[x][y-1]==1)
		{
			b[count]=0;
			count++;
		}
		if (a[x+1][y]==1)
		{
			b[count]=1;
			count++;
		}
		if (a[x][y+1]==1)
		{
			b[count]=2;
			count++;
		}
		if (a[x-1][y]==1)
		{
			b[count]=3;
			count++;
		}
		count=new Random().nextInt(count);
		
		return b[count];
		}
	

}
